﻿$(function () {
    //header_nav导航
    var nav_sub = $(".nav-sub");
    var lis = nav_sub.children("li");
    var lblName = $(".use-nn2");
    var closenas = $(".closesna");
    var right_conent = $(".right-conent");
    $.each(lis, function (i, ele) {
        $(ele).attr("index", i);
        $(ele).click(function () {            
            $.each(right_conent, function (j, elem) {
                $(elem).fadeOut();
            });           
            var index = $(this).attr("index");
            right_conent.eq(index).fadeIn();              
        });
    });
    //关闭
    $.each(closenas, function (i, ele) {
        $(ele).click(function () {
            $.each(right_conent, function (j, elem) {
                $(elem).fadeOut();
            });
        });
    });
    var main_l = $('.main-left');
    var main_r = $('.main-right');
    if ($(window).width() < 600) {
        main_l.css('width', '33%');
        main_r.css('width', '67%');
    } else {
        main_l.css('width', '17%');
        main_r.css('width', '83%');
    }
    /*获取窗口大小*/
    $(window).resize(function () {
        if ($(window).width() < 600) {
            main_l.css('width', '33%');
            main_r.css('width', '67%');
        } else {
            main_l.css('width', '17%');
            main_r.css('width', '83%');
        }
            
    });
});